import { GSprite } from "../../../../../com/mui/controls/GSprite";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class GuildUnionNameTip
    
    export  class GuildUnionNameTip extends GSprite
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            this._bg = ObjCreate.createBg(0, 0, 110, 45, this, ImagesConst.topRight);
            this._text = ObjCreate.createGTextField("", 0, 0, 200, 20, this);
            this._text.autoSize = flash.text.TextFieldAutoSize.LEFT;
            return;
        }

        public setGuildName(arg1: string): void
        {
            this._text.htmlText = HTMLUtil.addColor(arg1, "#FFFFFF");
            this.resize();
            return;
        }

        /* internal  */resize(): void
        {
            var loc1=this._text.textWidth;
            var loc2=this._text.textHeight;
            this._bg.width = loc1 + 10 > 65 ? loc1 + 10 : 65;
            this._bg.x = -this._bg.width + 10;
            this._text.x = this._bg.x + 5;
            this._text.y = 22;
            return;
        }

        /* internal */ /* var */_bg: ScaleBitmap;

        /* internal */ /* var */_text: GTextFiled;
    }
